<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon"  th:href="@{/static/favicon.ico}"/>
    <link rel="stylesheet" href="/layui/css/layui.css"  media="all">
    <script type="text/javascript" src="/layui/jquery-3.5.1.min.js"></script>
    <script src="/layui/layui.js" charset="utf-8"></script>
    <script th:inline="javascript">
        layui.use(['form', 'layedit', 'laydate', 'jquery'], function(){
            var form = layui.form
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate
                ,$ = layui.jquery;

            var password=$("#applicating_staff_password").val();
            var applicationId=$("#applicationId").val();
            var verification=false;
            form.on('submit(demo1)', function(data){
                layer.prompt({title: '输入密码，并确认', formType: 1}, function(pass, index) {
                    if (pass == password) {
                        layer.close(index);
                        verification=true;
                    } else {
                        layer.msg('密码验证错误....');
                        verification=false;
                    }
                });
                return verification;
            });

            //订票台账
            $("#log").on("click",function () {
                //alert("传输数据====="+applicationId)
                layer.open({
                    type: 2,
                    area: ['1000px','500px'],
                    content: '/management/ticketAccount?id='+applicationId,
                    btn: ['关闭'],
                    yes: function () {
                        layer.closeAll();
                    },
                    zIndex: layer.zIndex
                });
            })
            //出差申请表
            $("#logTrval").on("click",function () {
                // var applicationId=$("#applicationId").val();
                layer.open({
                    type: 2,
                    area: ['1000px','500px'],
                    content: '/business-trip/applicationDetails?id='+applicationId,
                    btn: ['关闭'],
                    yes: function () {
                        layer.closeAll();
                    },
                    zIndex: layer.zIndex
                });
            })

            //酒店台账
            $("#logHotel").on("click",function () {
                var applicationId=$("#applicationId").val();
                // alert("id==========="+applicationId)
                layer.open({
                    type: 2,
                    area: ['1000px','500px'],
                    content: '/management/getHotelApplicationDetails?id='+applicationId,
                    btn: ['关闭'],
                    yes: function () {
                        layer.closeAll();
                    },
                    zIndex: layer.zIndex
                });
            })
        });




    </script>
        </head>
<body>
<button class="layui-btn layui-btn-sm" style="position: fixed" onClick="javascript :history.back(-1);">返回</button>
<form class="layui-form" action="/reimbursement/submitReimbursement" type="post">

    <fieldset class="layui-elem-field"  style="width: 80%;height: 100px;margin: auto;padding-top: 30px">

    <legend>报销申请表</legend>
    <div class="layui-inline">
        <label class="layui-form-label">申请人</label>
        <div class="layui-input-inline"  name="quiz1">
            <input type="text" th:value="${session.user.name}" lay-verify="required"  name="price_min" readonly="readonly" autocomplete="off" class="layui-input">
            <input type="hidden" th:value="${session.user.id}" name="userId" id="applicating_staff">
            <input type="hidden" th:value="${session.user.getPassword()}" name="staff.password" id="applicating_staff_password">
        </div>
    </div>
             <div class="layui-inline">
                 <label class="layui-form-label">报销类型</label>

                 <div class="layui-input-inline"   name="quiz1">
                     <input type="text" th:value="${dictionary.value}"  lay-verify="required"  name="dictionaryValue" readonly="readonly" autocomplete="off" class="layui-input">
                     <input type="hidden" th:value="${dictionary.id}" name="dictionaryId" id="dictionaryId">

                 </div>
             </div>

</fieldset>

    <fieldset class="layui-elem-field"  style="width: 80%;margin: auto;padding-top: 30px">
        <legend>详情</legend>

        <div class="layui-inline">
        <label class="layui-form-label">申请编号</label>
        <div class="layui-input-inline">
            <input type="text" th:value="${details.getNumbering()}" lay-verify="required"  name="price_min" readonly="readonly" autocomplete="off" class="layui-input">
            <input type="hidden" th:value="${details.getId()}" lay-verify="required"  id="applicationId" name="travelApplicationId" readonly="readonly" autocomplete="off" class="layui-input">
        </div>
    </div>

    </div>
        <!--订票台账-->
        <div class="layui-inline" th:if="${dictionary.id==19}">
            <div class="layui-input-inline">
                <button type="button" id="log" class="layui-btn">查看台账</button>
            </div>
        </div>
        <!--出差申请表-->
        <div class="layui-inline" th:if="${dictionary.id==20}">
            <div class="layui-input-inline">
                <button type="button" id="logTrval" class="layui-btn">查看详情</button>
            </div>
        </div>
        <!--酒店台账-->
        <div class="layui-inline" th:if="${dictionary.id==38}">
            <div class="layui-input-inline">
                <button type="button" id="logHotel" class="layui-btn">查看入住</button>
            </div>
        </div>
    </fieldset>


    <fieldset class="layui-elem-field"  style="width: 80%;margin: auto;padding-top: 30px">
    <legend>报销金额</legend>

        <div class="layui-inline">
            <label class="layui-form-label">报销总额</label>
            <div class="layui-input-inline" style="width: 25%">
                <input th:if="${price ne null}"   type="text" readonly="readonly"   lay-verify="number" th:value="${price}" name="aircrafTicket" placeholder="￥" autocomplete="off" class="layui-input">
                <input th:unless="${price ne null}"   type="text"   lay-verify="number"  name="aircrafTicket" placeholder="￥" autocomplete="off" class="layui-input">
                <div class="layui-form-mid layui-word-aux">单位：元</div>
            </div>
        </div>
    </fieldset>


    <fieldset class="layui-elem-field"  style="width: 80%;margin: auto;padding-top: 30px">
        <legend>备注</legend>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label"></label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" name="remark" class="layui-textarea"></textarea>
            </div>
        </div>


    </fieldset>


    <input type="hidden" name="location" id="location">
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button style="margin-left: 600px" type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            <div class="layui-form-mid layui-word-aux">密码验证成功后再次提交</div>

        </div>
    </div>
</form>




</body>
</html>